<div class="nav layui-hide-xs">
    <div class="layui-container">
        <div class="layui-row">
            <div class="layui-col-md3">

                <div class="logo">
                    <a href="/"><img src="/static/index/images/logo.png" alt="logo"></a>
                </div>


            </div>
            <div class="layui-col-md6 layui-col-md-offset1 nav-a">

                <div class="layui-row">

                    <div class="layui-col-md2">
                        <a class="nav-item" href="/"><span>首页</span></a>
                    </div>

                    <div class="layui-col-md2">
                        <a class="nav-item nav-tour" href="{:url('tour/tourList')}"><span>景点</span></a>
                    </div>

                    <div class="layui-col-md2">
                        <a class="nav-item nav-hotel" href="{:url('hotel/hotelList')}"><span>酒店</span></a>
                    </div>

                    <div class="layui-col-md2">
                        <a class="nav-item nav-restaurant" href="{:url('food/foodList')}"><span>美食</span></a>
                    </div>

                    <div class="layui-col-md2">
                        <a class="nav-item nav-group" href="{:url('group/groupList')}"><span>跟团</span></a>
                    </div>

                    <div class="layui-col-md2">
                        <a class="nav-item nav-circle" href="{:url('circle/circleList')}"><span>友圈</span></a>
                    </div>

                </div>

            </div>
            <div class="layui-col-md2">
                <div class="loginButtonBox">
                    {empty name="Think.session.uid"}
                    <a class="loginButton" href="{:url('login/login')}">登录/注册</a>
                    {else/}
                    <div class="al-log-show">
                            <a class="alreadyButton">{$Think.session.nickname}</a>
                            <div class="login-show-box">
                                <div class="login-show-box-cen">
                                    <a href="{:url('my/other')}">个人中心</a>
                                    <a href="javascript:;">修改密码</a>
                                    <a style="margin-bottom: 0;" href="javascript:;" id="logout">退出登录</a>
                                </div>
                            </div>
                        </div>
                    {/empty}
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/static/layuiadmin/layui/layui.all.js"></script>
<script>
    $ = layui.jquery;
    var nav_active = "[model]";

    $('.nav-item').removeClass('nav-item-active');

    var theItem = 'nav-'+nav_active;

    $("."+theItem).addClass('nav-item-active');

    $('.alreadyButton').mouseenter(function(){

            $('.login-show-box').show();
        });

        $('.alreadyButton').mouseleave(function(){
            
            $('.login-show-box').hide();
        });

        $('.login-show-box-cen').mouseenter(function(){
            
            $('.login-show-box').show();
        });

        $('.login-show-box-cen').mouseleave(function(){
            
            $('.login-show-box').hide();
        });

        $('#logout').click(function(){

            layer.alert('确认退出登录吗？',function(){
                $.ajax({
                    type: "post",
                    url: "{:url('Index/loginout')}",
                    dataType: 'json',
                    data: {},
                    success: function (data) {
                        if (data.code) {

                                layer.closeAll();

                                layer.msg('退出成功',{anim: 0,time:1000},function(){
                                    window.location.reload();
                                });
                        }
                    }
                });
            });
        })





</script>

